﻿namespace EFS.RC.SupervisorCentral.Common
{
	public static class Main
	{
		public static System.String GetReportViewURL(
			System.String reportName,
			System.String[] paramNames,
			System.String[] paramValues)
		{
			// create url
			System.Text.StringBuilder sbUrl = new System.Text.StringBuilder();
			sbUrl.AppendFormat("{0}/Pages/ReportViewer.aspx?{1}/{2}&rs:Command=Render",
				EFS.RC.SupervisorCentral.Common.Config.Main.Reports.Main.ServerURL,
				EFS.RC.SupervisorCentral.Common.Config.Main.Reports.Main.ReportsLocalPath,
				reportName);

			if (null != paramNames && paramNames.Length > 0)
			{
				for (System.Int32 i = 0; i < paramNames.Length; ++i)
				{
					sbUrl.AppendFormat("&{0}={1}", paramNames[i], paramValues[i]);
				}
			}

			// ok
			return sbUrl.ToString();
		}
	}

}